// 引入three.js
import * as THREE from "three";

//创建场景
export const scene = new THREE.Scene();

//创建相机
export const camera = new THREE.PerspectiveCamera(
  75,
  window.innerWidth / window.innerHeight,
  0.1,
  1000
);

//创建渲染器
export const renderer = new THREE.WebGLRenderer({
  antialias: true, //减少边缘齿轮
});
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.shadowMap.enabled = true; //开启阴影投射
document.body.appendChild(renderer.domElement);

//灯光
export const createLight = new THREE.DirectionalLight(0xffffff, 1);